<?php

class Model_Mine extends Model_Table {

	//设置表名 返回
	public function setTable($tableName){
		$this->_name = str_inmysql($tableName);
		return $this;
	}
	
	public function findRow($where,$field='*'){
		$filter['where'] = $where;
		$filter['order'] = "id asc";
		$sql =	$this->select($filter,$field);
		$result = $this->fetchRow($sql);
		return $result;
	}
	
	public function findAll($where=false,$field='*',$order=false,$limit=false){
		$filter['where'] = $where ? $where : 'id>0';
		$filter['order'] = $order ? $order : "id asc";
		$filter['limit'] = $limit ? $limit : " 30";
		$sql = $this->select($filter,$field);
		$result = $this->fetchAll($sql);
		return $result;
	}
	
	
}

